# -*- coding: utf-8 -*-


import os
import uuid
import django
from datetime import datetime
from core.initialize import Initialize
from apps.sys.models import Menu, DictType, DictData

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "application.settings")
django.setup()


class Init(Initialize):

    def init_dict(self):
        dict_type = [
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "产品类型",
                "type": "pms_product_type",
                "remark": "产品类型列表",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求分类",
                "type": "pms_req_classify",
                "remark": "产品需求分类列表",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求关闭类型",
                "type": "pms_req_close",
                "remark": "需求关闭类型列表",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求来源",
                "type": "pms_req_origin",
                "remark": "产品需求来源列表",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求状态",
                "type": "pms_req_status",
                "remark": "需求状态列表",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求阶段",
                "type": "pms_req_stage",
                "remark": "需求阶段列表",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求评审结果",
                "type": "pms_req_review",
                "remark": "需求评审结果列表",
            },
        ]
        dict_data = [
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_product_type",
                "sort": 1,
                "label": "正常",
                "value": "0",
                "tagType": "default",
                "tagClass": "",
                "remark": "正常类型",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_product_type",
                "sort": 2,
                "label": "多分支",
                "value": "1",
                "tagType": "default",
                "tagClass": "",
                "remark": "多分支类型",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_product_type",
                "sort": 3,
                "label": "多平台",
                "value": "2",
                "tagType": "default",
                "tagClass": "",
                "remark": "多平台类型",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_classify",
                "sort": 1,
                "label": "功能",
                "value": "0",
                "tagType": "default",
                "tagClass": "",
                "remark": "产品功能类需求",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_classify",
                "sort": 2,
                "label": "性能",
                "value": "1",
                "tagType": "default",
                "tagClass": "",
                "remark": "产品性能类需求",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_classify",
                "sort": 3,
                "label": "接口",
                "value": "2",
                "tagType": "default",
                "tagClass": "",
                "remark": "产品接口类需求",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_classify",
                "sort": 4,
                "label": "安全",
                "value": "3",
                "tagType": "default",
                "tagClass": "",
                "remark": "产品安全类需求",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_classify",
                "sort": 5,
                "label": "体验",
                "value": "4",
                "tagType": "default",
                "tagClass": "",
                "remark": "产品体验类需求",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_classify",
                "sort": 6,
                "label": "改进",
                "value": "5",
                "tagType": "default",
                "tagClass": "",
                "remark": "产品改进类需求",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_classify",
                "sort": 7,
                "label": "其他",
                "value": "6",
                "tagType": "default",
                "tagClass": "",
                "remark": "产品其他类需求",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_close",
                "sort": 1,
                "label": "已完成",
                "value": "0",
                "tagType": "success",
                "tagClass": "",
                "remark": "已完成",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_close",
                "sort": 2,
                "label": "重复",
                "value": "1",
                "tagType": "warning",
                "tagClass": "",
                "remark": "重复",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_close",
                "sort": 3,
                "label": "延期",
                "value": "2",
                "tagType": "warning",
                "tagClass": "",
                "remark": "延期",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_close",
                "sort": 4,
                "label": "不做",
                "value": "3",
                "tagType": "primary",
                "tagClass": "",
                "remark": "不做",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_close",
                "sort": 5,
                "label": "已取消",
                "value": "4",
                "tagType": "danger",
                "tagClass": "",
                "remark": "已取消",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_close",
                "sort": 6,
                "label": "设计如此",
                "value": "5",
                "tagType": "primary",
                "tagClass": "",
                "remark": "设计如此",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 1,
                "label": "客户/用户",
                "value": "0",
                "tagType": "default",
                "tagClass": "",
                "remark": "客户/用户",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 2,
                "label": "产品经理",
                "value": "1",
                "tagType": "default",
                "tagClass": "",
                "remark": "产品经理",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 3,
                "label": "市场",
                "value": "2",
                "tagType": "default",
                "tagClass": "",
                "remark": "市场",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 4,
                "label": "运营",
                "value": "3",
                "tagType": "default",
                "tagClass": "",
                "remark": "运营",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 5,
                "label": "技术支持",
                "value": "4",
                "tagType": "default",
                "tagClass": "",
                "remark": "技术支持",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 6,
                "label": "竞争对手",
                "value": "5",
                "tagType": "default",
                "tagClass": "",
                "remark": "竞争对手",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 7,
                "label": "合作伙伴",
                "value": "6",
                "tagType": "default",
                "tagClass": "",
                "remark": "合作伙伴",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 8,
                "label": "开发人员",
                "value": "7",
                "tagType": "default",
                "tagClass": "",
                "remark": "开发人员",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 9,
                "label": "测试人员",
                "value": "8",
                "tagType": "default",
                "tagClass": "",
                "remark": "测试人员",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 10,
                "label": "产品缺陷",
                "value": "9",
                "tagType": "default",
                "tagClass": "",
                "remark": "产品缺陷",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 11,
                "label": "相关会议",
                "value": "10",
                "tagType": "default",
                "tagClass": "",
                "remark": "相关会议",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 12,
                "label": "博客论坛",
                "value": "11",
                "tagType": "default",
                "tagClass": "",
                "remark": "博客论坛",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_origin",
                "sort": 13,
                "label": "其他",
                "value": "12",
                "tagType": "default",
                "tagClass": "",
                "remark": "其他",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_status",
                "sort": 1,
                "label": "草稿",
                "value": "draft",
                "tagType": "warning",
                "tagClass": "",
                "remark": "草稿",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_status",
                "sort": 2,
                "label": "评审中",
                "value": "reviewing",
                "tagType": "primary",
                "tagClass": "",
                "remark": "评审中",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_status",
                "sort": 3,
                "label": "已激活",
                "value": "activated",
                "tagType": "success",
                "tagClass": "",
                "remark": "已激活",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_status",
                "sort": 4,
                "label": "已变更",
                "value": "changed",
                "tagType": "warning",
                "tagClass": "",
                "remark": "已变更",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_status",
                "sort": 4,
                "label": "已关闭",
                "value": "closed",
                "tagType": "info",
                "tagClass": "",
                "remark": "已关闭",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_stage",
                "sort": 1,
                "label": "未开始",
                "value": "0",
                "tagType": "warning",
                "tagClass": "",
                "remark": "未开始",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_stage",
                "sort": 2,
                "label": "已计划",
                "value": "1",
                "tagType": "default",
                "tagClass": "",
                "remark": "已计划",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_stage",
                "sort": 3,
                "label": "已立项",
                "value": "2",
                "tagType": "default",
                "tagClass": "",
                "remark": "已计划",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_stage",
                "sort": 4,
                "label": "开发中",
                "value": "3",
                "tagType": "default",
                "tagClass": "",
                "remark": "开发中",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_stage",
                "sort": 5,
                "label": "开发完毕",
                "value": "4",
                "tagType": "primary",
                "tagClass": "",
                "remark": "开发完毕",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_stage",
                "sort": 6,
                "label": "测试中",
                "value": "5",
                "tagType": "default",
                "tagClass": "",
                "remark": "测试中",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_stage",
                "sort": 7,
                "label": "测试完毕",
                "value": "6",
                "tagType": "primary",
                "tagClass": "",
                "remark": "测试完毕",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_stage",
                "sort": 8,
                "label": "已验收",
                "value": "7",
                "tagType": "primary",
                "tagClass": "",
                "remark": "已验收",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_stage",
                "sort": 9,
                "label": "已发布",
                "value": "8",
                "tagType": "success",
                "tagClass": "",
                "remark": "已发布",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_review",
                "sort": 1,
                "label": "确认通过",
                "value": "0",
                "tagType": "success",
                "tagClass": "",
                "remark": "确认通过",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_review",
                "sort": 2,
                "label": "有待明确",
                "value": "1",
                "tagType": "warning",
                "tagClass": "",
                "remark": "有待明确",
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "default": True,
                "id": uuid.uuid4(),
                "type": "pms_req_review",
                "sort": 3,
                "label": "拒绝",
                "value": "2",
                "tagType": "danger",
                "tagClass": "",
                "remark": "拒绝",
            },
        ]
        self.save(DictType, dict_type, "字典类型")
        self.save(DictData, dict_data, "字典数据")

    def init_menu(self):
        """
        初始化菜单表-产品管理
        """
        pms = uuid.uuid4()
        pms_product = uuid.uuid4()
        pms_module = uuid.uuid4()
        pms_version = uuid.uuid4()
        pms_requirement = uuid.uuid4()
        self.menu_pms_data = [
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": pms,
                "name": "产品管理",
                "type": "M",
                "icon": "product-management",
                "path": "/pms",
                "component": "Layout",
                "perms": None,
                "nesting": True,
                "redirect": "noRedirect",
                "parent_id": None,
                "sort": 2,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": pms_product,
                "name": "产品信息",
                "type": "C",
                "icon": "product",
                "path": "product",
                "component": "pms/product/index",
                "perms": "pms:product:list",
                "parent_id": pms,
                "sort": 1,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "产品查询",
                "type": "F",
                "icon": "#",
                "perms": "pms:product:query",
                "parent_id": pms_product,
                "sort": 1,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "产品新增",
                "type": "F",
                "icon": "#",
                "perms": "pms:product:add",
                "parent_id": pms_product,
                "sort": 2,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "产品修改",
                "type": "F",
                "icon": "#",
                "perms": "pms:product:edit",
                "parent_id": pms_product,
                "sort": 3,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "产品删除",
                "type": "F",
                "icon": "#",
                "perms": "pms:product:delete",
                "parent_id": pms_product,
                "sort": 4,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "产品导入",
                "type": "F",
                "icon": "#",
                "perms": "pms:product:import",
                "parent_id": pms_product,
                "sort": 5,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "产品导出",
                "type": "F",
                "icon": "#",
                "perms": "pms:product:export",
                "parent_id": pms_product,
                "sort": 6,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "产品同步",
                "type": "F",
                "icon": "#",
                "perms": "pms:product:sync",
                "parent_id": pms_product,
                "sort": 7,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": pms_module,
                "name": "模块信息",
                "type": "C",
                "icon": "module",
                "path": "module",
                "component": "pms/module/index",
                "perms": "pms:module:list",
                "parent_id": pms,
                "sort": 2,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "模块查询",
                "type": "F",
                "icon": "#",
                "perms": "pms:module:query",
                "parent_id": pms_module,
                "sort": 1,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "模块新增",
                "type": "F",
                "icon": "#",
                "perms": "pms:module:add",
                "parent_id": pms_module,
                "sort": 2,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "模块修改",
                "type": "F",
                "icon": "#",
                "perms": "pms:module:edit",
                "parent_id": pms_module,
                "sort": 3,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "模块删除",
                "type": "F",
                "icon": "#",
                "perms": "pms:module:delete",
                "parent_id": pms_module,
                "sort": 4,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "模块导入",
                "type": "F",
                "icon": "#",
                "perms": "pms:module:import",
                "parent_id": pms_module,
                "sort": 5,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "模块导出",
                "type": "F",
                "icon": "#",
                "perms": "pms:module:export",
                "parent_id": pms_module,
                "sort": 6,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": pms_version,
                "name": "版本信息",
                "type": "C",
                "icon": "version",
                "path": "version",
                "component": "pms/version/index",
                "perms": "pms:version:list",
                "parent_id": pms,
                "sort": 3,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "版本查询",
                "type": "F",
                "icon": "#",
                "perms": "pms:version:query",
                "parent_id": pms_version,
                "sort": 1,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "版本新增",
                "type": "F",
                "icon": "#",
                "perms": "pms:version:add",
                "parent_id": pms_version,
                "sort": 2,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "版本修改",
                "type": "F",
                "icon": "#",
                "perms": "pms:version:edit",
                "parent_id": pms_version,
                "sort": 3,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "版本删除",
                "type": "F",
                "icon": "#",
                "perms": "pms:version:delete",
                "parent_id": pms_version,
                "sort": 4,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "版本导入",
                "type": "F",
                "icon": "#",
                "perms": "pms:version:import",
                "parent_id": pms_version,
                "sort": 5,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "版本导出",
                "type": "F",
                "icon": "#",
                "perms": "pms:version:export",
                "parent_id": pms_version,
                "sort": 6,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": pms_requirement,
                "name": "需求信息",
                "type": "C",
                "icon": "requirement",
                "path": "requirement",
                "component": "pms/requirement/index",
                "perms": "pms:requirement:list",
                "parent_id": pms,
                "sort": 4,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求查询",
                "type": "F",
                "icon": "#",
                "perms": "pms:requirement:query",
                "parent_id": pms_requirement,
                "sort": 1,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求新增",
                "type": "F",
                "icon": "#",
                "perms": "pms:requirement:add",
                "parent_id": pms_requirement,
                "sort": 2,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求修改",
                "type": "F",
                "icon": "#",
                "perms": "pms:requirement:edit",
                "parent_id": pms_requirement,
                "sort": 3,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求删除",
                "type": "F",
                "icon": "#",
                "perms": "pms:requirement:delete",
                "parent_id": pms_requirement,
                "sort": 4,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求导入",
                "type": "F",
                "icon": "#",
                "perms": "pms:requirement:import",
                "parent_id": pms_requirement,
                "sort": 5,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求导出",
                "type": "F",
                "icon": "#",
                "perms": "pms:requirement:export",
                "parent_id": pms_requirement,
                "sort": 6,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求激活",
                "type": "F",
                "icon": "#",
                "perms": "pms:requirement:active",
                "parent_id": pms_requirement,
                "sort": 7,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求变更",
                "type": "F",
                "icon": "#",
                "perms": "pms:requirement:change",
                "parent_id": pms_requirement,
                "sort": 8,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求评审",
                "type": "F",
                "icon": "#",
                "perms": "pms:requirement:review",
                "parent_id": pms_requirement,
                "sort": 9,
            },
            {
                "dept_belong_id": self.dept_belong_id,
                "update_time": datetime.now(),
                "create_time": datetime.now(),
                "creator_id": self.creator_id,
                "id": uuid.uuid4(),
                "name": "需求关闭",
                "type": "F",
                "icon": "#",
                "perms": "pms:requirement:close",
                "parent_id": pms_requirement,
                "sort": 10,
            },
        ]
        self.save(Menu, self.menu_pms_data, "菜单表")

    def run(self):
        self.init_dict()
        self.init_menu()


def main(reset=False):
    Init(reset).run()
    pass


if __name__ == "__main__":
    main()
